package com.dongjiantong.farmrecords.service;

import com.dongjiantong.common.web.sso.LoginInfo;
import com.dongjiantong.farmrecords.model.FarmRecordsDisinfect;
import com.dongjiantong.farmrecords.model.FarmRecordsFile;
import com.dongjiantong.mybatis.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

public interface FarmRecordsDisinfectService extends BaseService<FarmRecordsDisinfect> {

    /**
     * 根据条件进行分页查询 (无条件表示查询全部)
     * @param pageNum
     * @param pageSize
     * @param map   查询条件
     * @return  Response<PageInfo<FarmRecordsDisinfect>>
     */
    PageInfo<FarmRecordsDisinfect> selectByMap(Integer pageNum, Integer pageSize, Map map);

    /**
     * 新建一条记录
     * @param farmRecordsDisinfect
     * @param loginInfo
     * @param toStatus
     * @return  long 返回插入数据的id
     */
    Long createOne(LoginInfo loginInfo,FarmRecordsDisinfect farmRecordsDisinfect, Integer toStatus);

    /**
     * 更新一条记录 (根据id或者number)
     * @param farmRecordsDisinfect
     * @return  boolean (更新成功返回true 反之返回false)
     */
    Integer updateByIdOrNumber(FarmRecordsDisinfect farmRecordsDisinfect,Integer toStatus);

    /**
     * 养殖端
     * 根据提交状态分页查询列表
     * @param farmId
     * @param status
     * @return
     */
    PageInfo<FarmRecordsDisinfect> selectListByStatus(Integer pageNum, Integer pageSize, Integer status, Long farmId);

    /**
     * 放入图片 视频到对象中
     * @param farmRecordsDisinfect
     * @param farmRecordsFileList
     */
    FarmRecordsDisinfect setPicOrVideoByObject(FarmRecordsDisinfect farmRecordsDisinfect, List<FarmRecordsFile> farmRecordsFileList);
}
